/*
 * @Author: huangtianyang 916072572@qq.com
 * @Date: 2023-04-27 17:51:21
 * @LastEditors: huangtianyang
 * @LastEditTime: 2023-10-11 09:20:37
 * @FilePath: \cxl-admin\src\apis\finance\refund.ts
 */
import axios from '../../axios/index'

interface refundParams {
    refundId: string
    companyId: string
    refundReason: number
    brank: string
    description: string
    bankAccount: string
    branches: string
    receiverName: string
}

/**
 * 企业退款审核
 * @param refundId: string
 * @param companyId: string
 * @param refundReason: number
 * @param brank: string
 * @param description: string
 * @param bankAccount: string
 * @param branches: string
 * @param receiverName: string
 * @returns
 */
export const refundApprove = (data: refundParams) => {
    return axios({
        method: 'post',
        url: '/api/mall/company/refund/approve-refund',
        data
    })
}

/**
 * 退款详情
 * @param storeRefundId
 * @returns
 */
export const refundDetailed = (storeRefundId: string) => {
    return axios({
        method: 'get',
        url: '/api/mall/company/refund/refund-detail',
        params: {
            storeRefundId
        }
    })
}

export interface refundParamsRefund {
    current: number
    size: number
    companyId?: string //企业id
    refundStatus?: number //退款状态（1.退款中；2.已退款）
}
/**
 *
 * @param params
 * @param current: number
 * @param size: number
 * @param companyId?: string //企业id
 * @param refundStatus?: number //退款状态（1.退款中；2.已退款）
 * @returns
 */
export const refundList = (params: refundParamsRefund) => {
    return axios({
        method: 'get',
        url: '/api/mall/company/refund/refundList',
        params
    })
}
